<!DOCTYPE html>
<html >

<head>
    <meta charset="utf-8">
    <title>智能检索--图片详情</title>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--layui-dropdown-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/layui/dropdown_2.3.3/dropdown.css">
    <!--extended-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--公用样式JS-->
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <#--<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>-->
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/tabs.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/ueditor/ueditor.all.min.js"></script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/ueditor/lang/zh-cn/zh-cn.js"></script>

</head>
<style>
    .Right {
        width: 100%;
        overflow-y: scroll;
    }

    .release ul:nth-child(2) li label {
        width: 28%;
    }

    .release ul:first-child li label {
        width: 33%;
    }

    .release .address, .personnel .address {
        width: 65%;
    }

    .sdDetaBtn button {
        width: 110px;
        height: 44px;
        margin: 10px 0;
        border: 1px solid #5775EF;
    }

    .filedetail {
        width: 95%;
        height: 1800px;
        margin: 1px 0 0 5%;
        padding-top: 5%;
    }

    .LeftFile {
        width: 69%;
        background: none;
    }

    .lifile {
        padding-left: 20px;
        text-align: left;
        width: 70%;

    }

    .spanleft {
        width: 20%;
        text-align: right;
        display: inline-block;
    }
    .spanRight {
        width: 70%;
        display: inline-block;
    }

    .fileoper {
        margin-bottom: 30px;
        border-bottom: 1px solid #e0e0e0;
        height: 65px;
    }
    .but{
        margin-left: 10px;
        width: 80px;
        height: 30px;
        border-radius: 6px;
    }
    .bqimage img{
        width: 30px;
        height: 30px;
    }


</style>

<body>
<!--头部-->
<header class="whitebg"></header>

<!--占位-->
<div class="Name mt50 bold ft20 clearfix"></div>
<!--容器-->
<div class="container clearfix">
    <!--左侧菜单栏-->
    <div class="LeftFile fl clearfix">
        <div class="filedetail whitebg center fr">
            <div class="fileoper">
                <div style="font-weight: bolder;font-size:larger;width: 62%;display: inline-block;float: left;text-align: left;box-sizing: border-box;padding-left: 30px">
                    <span>${file.fileName}</span>
                </div>
                <div style="width: 37%;float: left">
                    <button type="button"  id="dzbut" class="bluebg white bor0 fl ft10 but"

                            <#if '${zjdz}' == "1">
                                style="background-color:#FF0000"
                            </#if>
                            <#if '${zjdz}' == "0">
                                style="background-color:#c9c9c9"
                            </#if>
                            onclick="dzfile()"><img  style="height: 20px;width: 20px;" src="${re.contextPath}/plugin/common/images/dz3.png">点赞(<span id="dznum">${dznum}</span>)
                    </button>
                    <@shiro.hasPermission name="search:download">
                        <#if '${down}'=='1' >
                            <button type="button" class="bluebg white bor0 fl ft10 but"
                                    onclick="download()">下载
                            </button>
                        </#if>
                    </@shiro.hasPermission>
                </div>
            </div>
            <div class="clearfix fl" style="width: 100%;">
                <ul class="clearfix fl" style="width: 100%;">
                    <li class="lifile fl"  style="width: 45%">
                        <span style="width: 20%;" >关键字：</span>
                        <span class="spanRight">${file.searchKey}</span>
                        <input type="hidden"   id="id" value="${file.id}">
                    </li>
                    <li class="fl" style="width: 20%;text-align: left;">
                        <span style="width: 20%;">创作者：</span>
                        <span  style="width: 20%;">${file.createUsername}</span>
                    </li>
                    <li class="fl" style="width: 25%;">
                        <span  style="width: 20%;">上传时间：</span>
                        <span  style="width: 20%;">${file.createDateStr}</span>
                    </li>
                </ul>
                <ul>
                    <li class="lifile fl" style="width: 80%">
                        <span style="width: 20%;" >说明：</span>
                        <span class="spanRight">${file.remark}</span>
                    </li>
                </ul>
            </div>
            <div class="clearfix fl" style="width: 500px;height: 500px;margin-left: 20px;margin-top: 20px;">
                <#if  "${filetype}"=='图片' >
                       <img class="layui-upload-img ml10 "  style="width: 500px;height: 500px;"    src="/supervisor/projectManager/img?fid=${file.id}">
                 <#elseif "${filetype}"=='视频'>
                       <video  controlsList="nodownload" src="/supervisor/projectManager/img?fid=${file.id}" controls="controls" style="width: 100%"></video>
                  </#if>
            </div>
        </div>
    </div>
    <!--右侧内容-->
    <div class="Right fr  whitebg" style="width:30%;height: 1845px;" >
        <div class="releaseStatus whitebg blue clearfix" style="height: 1800px;">
            <div  style="color: black;font-weight: bolder;font-size: larger;">
                <span>
                    评价
                </span>
                <span>
                    (${commsize})
                </span>
            </div>
            <div>
                <textarea id="content" name="content" autocomplete="off"   style="width: 97%;height: 100px;"
                          lay-maxlength="200" lay-verify="maxlength">
                </textarea>
            </div>
            <div class="clearfix fr"  style="margin-top: 10px;">
                <button type="button" class="bluebg white bor0 fl ft10" style="margin-left: 12px;width: 80px;height: 30px; border-radius: 6px; "onclick="docoment()">评论
                </button>
            </div>
            <div class="fl" style="width: 100%">
                <ul class="fl"   id="ul_comm"  style="width: 100%">
                    <#list commlist as vo>
                        <li class="fl" style="width: 100%">
                            <div class="fl" style="width: 100%">
                                <div class="mineData fl clearfix mt10" style="width: 100%;">
                                    <#if    "${vo.xgtx}"!= "${null}" >
                                        <img class="ml10 fl " style="width: 50px;height: 50px" src="${vo.xgtx}" alt=""
                                             id="mainimg7">
                                    <#else>
                                            <img class="layui-upload-img ml10 fl" style="width: 50px;height: 50px"
                                                 id="mainimg7"
                                                 src="${re.contextPath}/plugin/common/images/29@2x.png">
                                    </#if>
                                    <nav class="fl ml10">
                                        <p class="fr18">
                                            ${vo.createUsername}
                                        </p>
                                        <p class="gary">
                                            ${vo.createDateStr}
                                        </p>
                                    </nav>
                                    <nav class="fr ml10">

                                        <p class="fr18" onclick="reply('${vo.commentId}')">
                                            <img  style="width:29px;height: 29px;margin-top: 0px;" src="${re.contextPath}/plugin/common/images/hf01.png"  alt="" >
                                           <span>
                                                  回复
                                           </span>

                                        </p>
                                    </nav>
                                </div>
                                <div style="margin-left: 15px;">
                              <span style="color: #666;" class='bqimage' >
                                ${vo.content}
                              </span>
                                </div>
                            </div>
                            <#list commlistReply as dto>
                                <#if '${dto.commentId}'== '${vo.commentId}'>
                                <div class="fl" style="width: 90%;margin-left: 30px;background-color: #f8f8f8">

                                    <div class="mineData fl clearfix mt10" style="width: 100%;">
                                        <#if    "${dto.xgtx}"!= "${null}" >
                                            <img class="ml10 fl " style="width: 50px;height: 50px" src="${dto.xgtx}"
                                                 alt=""
                                                 id="mainimg7">
                                        <#else>
                                            <#if "${user}" !="${null}" && (user.personType) == "002">
                                                <img class="layui-upload-img ml10 fl" style="width: 50px;height: 50px"
                                                     id="mainimg7"
                                                     src="/plugin/common/images/zzlogo.jpg">
                                            <#else>
                                                <img class="layui-upload-img ml10 fl" style="width: 50px;height: 50px"
                                                     id="mainimg7"
                                                     src="${re.contextPath}/plugin/common/images/29@2x.png">
                                            </#if>
                                        </#if>
                                        <nav class="fl ml10">
                                            <p class="fr18">
                                                ${dto.createUsername}
                                            </p>
                                            <p class="gary">
                                                ${dto.createDateStr}
                                            </p>
                                        </nav>
                                        <nav class="fr ml10">
                                            <p class="fr18">

                                            </p>
                                        </nav>
                                    </div>
                                    <div style="margin-left: 15px;">
                                          <span style="color: #666;">
                                            ${dto.content}
                                          </span>
                                    </div>


                                </div>
                                        </#if>
                            </#list>


                        </li>
                    </#list>
                </ul>
            </div>
        </div>
    </div>

    <!--应接项目-->

</div>
<!--JQ-->
<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.boot.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.common.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<script type="text/javascript" src="${re.contextPath}/pageoffice.js" id="po_js_main"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/form.file.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/layui/lay/extra/autocomplete.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/layui/dropdown_2.3.3/dropdown.js"></script>

<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/supplier/common/js/fileoper.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>

<!-- 公共配置第三方组件 -->
<script type="text/javascript">
    layui.config({
        version: false,
        debug: false,
        base: "${re.contextPath}/plugin/layui/lay/extra/"
    })
</script>


<!-- 公共配置第三方组件 -->
<script type="text/javascript">
    layui.config({
        version: false,
        debug: false,
        base: "${re.contextPath}/plugin/layui/dropdown_2.3.3/"
    })
</script>
<script type="text/javascript">
    $(document).bind('click', function (e) {
        var e = e || window.event; //浏览器兼容性
        var elem = e.target || e.srcElement;
        while (elem) { //循环判断至跟节点，防止点击的是div子元素
            if (elem.id && elem.id == 'more-btn-43f3f4e8276e43a491c9fa80272a0e1a') {
                return;
            }
            elem = elem.parentNode;
        }
        $('.layui-anim').css('display', 'none'); //点击的不是div或其子元素
    });
    var ue = UE.getEditor('content', {
        toolbars: [
            [
                'emotion' //表情
            ]
        ],
        initialFrameWidth: null,//宽度随浏览器自适应
        wordCount: false,//关闭字数统计
        autoHeightEnabled: false,//是否自动长高
    });

    setTimeout(function() {
        $("#edui2").css("height","25px");
        $("#edui1_bottombar").css("display","none")
    }, 20);

    function  viewFile() {
        var id= $("#id").val();
        POBrowser.openWindowModeless('/sys/office/openword?ft=1&fid=' + id, 'width=1200px;height=800px;', '{}')
    }

    function  download() {
        var id= $("#id").val();
        window.open("/supervisor/projectManager/exportFile?id=" + id);
    }
    function dzfile() {
        var dznum = $("#dznum").html();
        //#c9c9c9
        var id= $("#id").val();
        var json = {
            id: id
        }
        layerAjax('/search/znSerch/updateDz', json, '', function (d) {
            if (d.flag == true) {
                var data1 = d.data;
                if (data1.flag == 1) {
                    $("#dzbut").css("background-color","#FF0000");
                } else {
                    $("#dzbut").css("background-color","#c9c9c9");
                }
                $("#dznum").html(data1.num)
                layer.msg(d.msg, {icon: 1});
            } else {
                layer.msg(d.msg, {icon: 2});
            }
        });


    }


    function reply(commentId) {
        var id= $("#id").val();
        var commentId=commentId;
        var title = "";
        var w = "";
        var h = "";
        if (w == null || w == '') {
            w = "600";
        }
        ;
        if (h == null || h == '') {
            h = "400";;
        }
        var url = "/search/znSerch/plAddDetail?id=" + id+"&commentId="+commentId;
        parent.layer.open({
            id: 'form-list',
            type: 2,
            area: [w + 'px', h + 'px'],
            fix: false,
            maxmin: true,
            shadeClose: false,
            shade: 0.4,
            title: title,
            content: url,
            end: function () {
               window.location.reload();
            },
            success: function(layero){
            }
        });


    }

    function docoment() {
        var id= $("#id").val();
        var content = UE.getEditor('content').getContent();
        if(!content.trim()){
            layer.msg("请输入评论内容", {icon: 2});
            return false;
        }
        if(content.trim().length>300){
            layer.msg("评论内容不能大于300个字符", {icon: 2});
            return false;
        }
        var jsonc={
            id:id,
            content:content
        }
        layerAjax('/search/znSerch/savePL', jsonc, '', function (d) {
            if (d.flag == true) {
                var data=d.data;
                var  createDateStr=data.createDateStr;
                var  commentId=data.commentId;
                var  createUsername=data.createUsername;
                var  xgtx=data.xgtx;
                var  content=data.content.trim();
                if(!xgtx){
                    xgtx='${re.contextPath}/plugin/common/images/29@2x.png' ;

                }
         $("#ul_comm").append("    <li class=\"fl\" style=\"width: 100%\">\n" +
             "                    <div class=\"fl\" style=\"width: 100%\">\n" +
             "                    <div class=\"mineData fl clearfix mt10\" style=\"width: 100%;\">\n" +
             "                    <img class=\"ml10 fl \" style=\"width: 50px;height: 50px\" src=\""+xgtx+"\" alt=\"\" id=\"mainimg7\">\n" +
             "                    <nav class=\"fl ml10\">\n" +
             "                    <p class=\"fr18\">\n" +
             "                    "+createUsername+"\n" +
             "                    </p>\n" +
             "                    <p class=\"gary\">\n" +
             "                    "+createDateStr+"\n" +
             "                </p>\n" +
             "                </nav>\n" +
             "                <nav class=\"fr ml10\">\n" +
             "                    <p class=\"fr18\" onclick=\"reply('"+commentId+"')\">\n" +
             "                    <img style=\"width:29px;height: 29px;margin-top: 0px;\" src=\"/plugin/common/images/hf01.png\" alt=\"\">\n" +
             "                    <span>\n" +
             "                    回复\n" +
             "                    </span>\n" +
             "                    </p>\n" +
             "                    </nav>\n" +
             "                    </div>\n" +
             "                    <div style=\"margin-left: 15px;\">\n" +
             "                    <span  class='bqimage'  style=\"color: #666;\">\n" +
             "                    "+content+"\n" +
             "                </span>\n" +
             "                </div>\n" +
             "                </div>\n" +
             "                </li>");
                layer.msg(d.msg, {icon: 1});
                window.location.reload();
            } else {
                $('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
                layer.msg(d.msg, {icon: 2});
                window.location.reload();
            }
        });

    }

</script>
</body>

</html>